# Contributor: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
# Maintainer: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
pkgname=py3-amply
pkgver=0.1.6
pkgrel=2
pkgdesc="Python package for AMPL/GMPL datafile parsing"
url="https://github.com/willu47/amply"
arch="noarch"
license="EPL-1.0"
depends="python3 py3-parsing"
makedepends="py3-gpep517 py3-setuptools_scm py3-wheel"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://files.pythonhosted.org/packages/source/a/amply/amply-$pkgver.tar.gz"
builddir="$srcdir/amply-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
05494d323a3b2dba53fc568345941eedb3ea29d8f3227f9530d36619ec61ec33b6f1afbf6c46ef85c80dfb77eab91d97a135b6f9d56b60488c67c5e36569fed0  py3-amply-0.1.6.tar.gz
"
